<!DOCTYPE html>
<#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />
<#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
<#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
<#assign DutyDept = JspTaglibs["http://www.casic304.cn/DutyDept"]/>
<html>
<head>
    <meta charset="utf-8">
    <title>型号质量问题督办</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .qbdms-TBinformation{margin-left: 0;font-size: 15px}
        .qbdms-TBinformationText{margin-left: 145px;}
    </style>
</head>
<body class="listBody">
<div class="qbdms-bodyDiv">
    <div class="qbdms-backDiv">
        <div class="layui-table-view-body" style="padding: 0 24px 24px;">
            <div class="qbdms-formTitle" style="border-bottom: 1px solid #E5F0FF">型号质量问题督办 <i
                    class="qbdms-returnOn closeWindow">返回</i></div>
            <form class="layui-form treeFormPreview" requrl="${ctx}/qbdms/wQbdFalSupervise/get"
                  style="padding:24px 0 0 80px" lay-filter="wQbdFalSuperviseDataForm">
                <@fillDept.dept  id="tbxx"/>
                <div class="layui-row">
                    <div style="width: 40%">
                        <label class="layui-form-label qbdms-label" title="密级">密级<span
                                style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@secSelect.sec_select data_src=1 required=true name="secret"/>
                        </div>
                    </div>

                    <div style="width: 50%">
                        <label class="layui-form-label qbdms-label" title="型号代号">型号代号<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <select name="fModelsymbol" lay-filter="xh" lay-reqtext="型号代号是必填项" lay-verify="required"
                                    lay-search=""></select>
                        </div>
                    </div>

                    <div style="width: 50%">
                        <label class="layui-form-label qbdms-label" title="型号名称">型号名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" placeholder="请输入" autocomplete="off"
                                   class="layui-input textInput" readonly="readonly" name="fModelname"
                                   maxlength="50">
                        </div>
                    </div>

                    <div style="width: 50%">
                        <label class="layui-form-label qbdms-label" title="问题责任单位">问题责任单位<span
                                style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@DutyDept.dept css="layui-input filter-value" db=true filter="org" reqtext="问题责任单位是必填项" name="fDutydept" id="dutyDept" showIn="0" verify="required"/>
                        </div>
                    </div>

                    <div style="width: 80%">
                        <label class="layui-form-label qbdms-label">问题现象<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                                  <textarea placeholder="请输入" class="layui-textarea textAreaInput"
                                            name="fFailuredescription" rows="2" lay-verify="required"
                                            lay-reqtext="问题现象是必填项"
                                            maxlength="300" ></textarea>
                        </div>
                    </div>
                    <div class="layui-hide">
                        <input type="text" name="id" placeholder="请输入"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="id">
                        <input type="text" name="fDutydeptId" placeholder="请输入问题责任单位id"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="fDutydeptId">
                        <input type="text" name="fIfsupervise" placeholder="请输入"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="fIfsupervise">
                        <input type="text" name="fProblemid" placeholder="请输入质量问题id"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="fProblemid">
                        <input type="text" name="fIsGroupdown" placeholder="请输入"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="fIsGroupdown">
                    </div>

                    <div class="layui-form-item" style="margin-top: 48px">
                        <p style="text-align: left;margin-left: 146px;">
                            <a lay-submit lay-filter="wQbdFalSupervise" class="layui-btn privateSubmit qbdms-oneBtn" requrl="${ctx}/qbdms/wQbdFalSupervise/save">提交</a>
                            <button type="reset" id="closeWindow" style="margin-left: 10px;" class="layui-btn   layui-btn-sm btn-save qbdms-oneBtnLine">取消</button>
                        </p>
                    </div>

                </div>
            </form>
        </div>
    </div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','setter', 'propsHandle', 'laydate', 'jquery','commonDialog', 'common','publicMethods','qbdmsForm'], function () {

        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            setter = layui.setter,  // 配置信息
            layer = layui.layer,
            propsHandle = layui.propsHandle,
            publicMethods = layui.publicMethods,
            form = layui.qbdmsForm;

        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }

        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdFalSupervise/view/list';
        });

        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        var common = layui.common;
        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name: 'wQbdFalSuperviseDataForm',
            idValue: "${id}",
            primary: "id",
            getCallback: function (data) {

            },
            updateCallback: function (data) {
                if (common.filterRecord(data)) {
                    if ($(".privateSubmit")) {
                        $(".privateSubmit").attr("disabled", false).css("pointer-events", "auto");
                    }
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        layer.close(index);
                        window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdFalSupervise/view/list';
                    });
                } else {
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                }
                return false;
            }
        });

        // 进入页面初始化 填写人与部门
        var id_s = "${id}";

        // 型号代号
        var xhdh = ${wQbdXhdhs};

        var xhdhHtml = "<option value=\"\"></option>";
        $.each(xhdh, function (index, obj) {
            xhdhHtml += "  <option  xhmc='" + obj.fModelname + "' value='" + obj.fModelcode + "'  >" + obj.fModelcode + "</option>";
        });
        $("select[name='fModelsymbol']").html(xhdhHtml);
        form.render();

        form.on('select(xh)', function (data) {
            $("input[name='fModelname']").val(data.elem[data.elem.selectedIndex].getAttribute("xhmc"));
        });

        form.on('select(org)', function (data) {
            $("input[name='fDutydeptId']").val(data.elem[data.elem.selectedIndex].getAttribute("orgcode"));
        });

    });
</script>
</body>
</html>